package book;

public class Book {/*一本书的属性包括书名，作者，价格，类型，编号*/
    private String name;
    private String author;
    private int price;
    private String type;
    private int num;

    //提供构造方法
    public Book(String name, String author, int price, String type, int num) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
        this.num = num;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    //toString 方法打印
    @Override
    public String toString() {
        return "书名：" + name + ",  作者：" + author + ",  价格：" + price + ",  类型：" + type + ",  编号：" + num;
    }
}
